package ua.eug.robov2.schematic.wire;

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;

import ua.eug.robov2.ImageProvider;

import ua.eug.robov2.utils.Vector2i;

// class for joining 3 or 4 wires together
public class Junction extends WireActor {

	private final static TextureRegion dotp = ImageProvider.FindRegion("dotp");
	private final static TextureRegion dotn = ImageProvider.FindRegion("dotn");
	
	public Junction(Wire wire, Vector2i pos, int index) {
		super(wire, pos, index);
	}

	public void draw(Batch batch, float x, float y) {
		TextureRegion d = (wire.inp.state)?dotp:dotn;
		batch.draw(d,pos.x*8+x,pos.y*8+y);
	}

	@Override
	public Vector2i sheetPosition() {
		return pos;
	}

}
